package mylibrary.designPattern.strategy;

import mylibrary.designPattern.strategy.fly.FlyNoWay;
import mylibrary.designPattern.strategy.fly.FlyWithWings;
import mylibrary.designPattern.strategy.quack.QuackRegular;
import mylibrary.designPattern.strategy.quack.Squeak;

public class ADuck extends Duck{

	public void display() {
		System.out.println("I'm a duck");
	}
	
	public ADuck() {
		flyBehavior = new FlyWithWings();
		quackBehavior = new Squeak();
	}
	
	public void changeBehavior() {
		setFlyBehavior(new FlyNoWay());
		setQuackBehavior(new QuackRegular());
	}
	
	public static void main(String[] args) {
		ADuck duck = new ADuck();
		
		duck.performFly();
		duck.performQuack();
		duck.display();
		duck.swim();
		duck.changeBehavior();
		duck.performFly();
		duck.performQuack();
	}
	
}
